import request from '@/router/axios';
import { baseUrl } from '@/config/env';

export const readSystemRoleByPage = (param) => request({
    url: baseUrl + '/role/read/page',
    method: 'post',
    data:param
});

export const addSystemRole = (data) => request({
    url: baseUrl + '/role/save',
    method: 'post',
    data:data
})

export const editSystemRole = (data) => request({
    url: baseUrl + '/role/save',
    method: 'post',
    data:data
})

export const delSystemRole = (id) => request({
    url: baseUrl + '/role/delete',
    method: 'post',
    data: { id: id }
})


export const readRoleMenu = (param) => request({
    url: baseUrl + '/role/read/menu',
    method: 'post',
    data:param
});

export const setRoleMenu = (param) => request({
    url: baseUrl + '/role/update/menu',
    method: 'post',
    data:param
});

export const readRolePermission = (param) => request({
    url: baseUrl + '/role/read/permission',
    method: 'post',
    data:param
});

export const setRolePermission = (param) => request({
    url: baseUrl + '/role/update/permission',
    method: 'post',
    data:param
});